﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Timetable.Base.Entities;
using Timetable.Base.Interfaces.Repositories;
using Timetable.Base.Interfaces.Validators;
using Ninject;

namespace Timetable.Data.Services.DataServices
{
    public class BuildingService: BaseDataService<Building>
    {
        IRepository<Building> _repository;
        IValidator<Building> _validator;

        [Inject]
        public BuildingService(IRepository<Building> repository, IValidator<Building> validator)
        {
            _repository = repository; 
            _validator = validator;
        }

        public override Base.Interfaces.Repositories.IRepository<Building> Repository
        {
            get { return _repository; }
        }

        public override Base.Interfaces.Validators.IValidator<Building> Validator
        {
            get { return _validator; }
        }

        public override IQueryable<Building> All()
        {
            return _repository.Get();
        }

        public override Building GetById(int id)
        {
            return _repository.GetById(id);
        }
    }
}
